<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'tusuarios-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Campos <span class="required">*</span> son requeridos.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'login'); ?>
		<?php echo $form->textField($model,'login',array('size'=>40,'maxlength'=>40,'readonly'=>!$model->isNewRecord)); ?>
		<?php echo $form->error($model,'login'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'nombre'); ?>
		<?php echo $form->textField($model,'nombre',array('size'=>60,'maxlength'=>75)); ?>
		<?php echo $form->error($model,'nombre'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'contrasena'); ?>
		<?php echo $form->passwordField($model,'contrasena',array('size'=>45,'maxlength'=>45,'readonly'=>!$model->isNewRecord)); ?>
		<?php echo $form->error($model,'contrasena'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'estado'); ?>
		<?php echo $form->dropDownList($model,'estado',TUtilidades::obtenerEstado()); ?>
		<?php echo $form->error($model,'estado'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'conectado'); ?>
		<?php echo $form->dropDownList($model,'conectado',TUtilidades::obtenerConexion()); ?>
		<?php echo $form->error($model,'conectado'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'codigointerno'); ?>
		<?php echo $form->textField($model,'codigointerno'); ?>
		<?php echo $form->error($model,'codigointerno'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'roles_id'); ?>
		<?php echo $form->dropDownList($model,'roles_id',TUtilidades::obtenerRoles(),array('empty'=>'--Seleccione--')); ?>
		<?php echo $form->error($model,'roles_id'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Crear Usuario' : 'Guardar'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->